<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE BangPatterns, CPP, MagicHash, Rank2Types,
    RecordWildCards, UnboxedTuples, UnliftedFFITypes #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-unused-matches #-}</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- Module      : Data.Text.Array</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Copyright   : (c) 2009, 2010, 2011 Bryan O'Sullivan</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     : BSD-style</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Maintainer  : bos@serpentine.com</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Portability : portable</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Packed, unboxed, heap-resident arrays.  Suitable for performance</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- critical use, both in terms of large data quantities and high</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- speed.</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- This module is intended to be imported @qualified@, to avoid name</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- clashes with &quot;Prelude&quot; functions, e.g.</span><span>
</span><span id="line-18"></span><span class="hs-comment">--</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- &gt; import qualified Data.Text.Array as A</span><span>
</span><span id="line-20"></span><span class="hs-comment">--</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- The names in this module resemble those in the 'Data.Array' family</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- of modules, but are shorter due to the assumption of qualified</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- naming.</span><span>
</span><span id="line-24"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Text.Array</span><span>
</span><span id="line-25"></span><span>    </span><span class="hs-special">(</span><span>
</span><span id="line-26"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Types</span></span><span>
</span><span id="line-27"></span><span>      </span><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier">Array</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier">MArray</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Functions</span></span><span>
</span><span id="line-30"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Array.html#copyM"><span class="hs-identifier">copyM</span></a></span><span>
</span><span id="line-31"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Array.html#copyI"><span class="hs-identifier">copyI</span></a></span><span>
</span><span id="line-32"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Array.html#empty"><span class="hs-identifier">empty</span></a></span><span>
</span><span id="line-33"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Array.html#equal"><span class="hs-identifier">equal</span></a></span><span>
</span><span id="line-34"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Array.html#run"><span class="hs-identifier">run</span></a></span><span>
</span><span id="line-35"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Array.html#run2"><span class="hs-identifier">run2</span></a></span><span>
</span><span id="line-36"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Array.html#toList"><span class="hs-identifier">toList</span></a></span><span>
</span><span id="line-37"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Array.html#unsafeFreeze"><span class="hs-identifier">unsafeFreeze</span></a></span><span>
</span><span id="line-38"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Array.html#unsafeIndex"><span class="hs-identifier">unsafeIndex</span></a></span><span>
</span><span id="line-39"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Array.html#new"><span class="hs-identifier">new</span></a></span><span>
</span><span id="line-40"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Array.html#unsafeWrite"><span class="hs-identifier">unsafeWrite</span></a></span><span>
</span><span id="line-41"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#if defined(ASSERTS)
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Control.Exception</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">assert</span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">GHC.Base</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">sizeofByteArray#</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">sizeofMutableByteArray#</span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">GHC.Stack</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">HasCallStack</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.ST.Unsafe.html#"><span class="hs-identifier">Control.Monad.ST.Unsafe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#unsafeIOToST"><span class="hs-identifier">unsafeIOToST</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#"><span class="hs-identifier">Data.Bits</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator">(.&amp;.)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#xor"><span class="hs-identifier">xor</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.Unsafe.html"><span class="hs-identifier">Data.Text.Internal.Unsafe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Unsafe.html#inlinePerformIO"><span class="hs-identifier">inlinePerformIO</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Text.Internal.Unsafe.Shift.html"><span class="hs-identifier">Data.Text.Internal.Unsafe.Shift</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Internal.Unsafe.Shift.html#shiftL"><span class="hs-identifier">shiftL</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Text.Internal.Unsafe.Shift.html#shiftR"><span class="hs-identifier">shiftR</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#"><span class="hs-identifier">Foreign.C.Types</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CInt"><span class="hs-identifier">CInt</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CInt"><span class="hs-identifier">CInt</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CSize"><span class="hs-identifier">CSize</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CSize"><span class="hs-identifier">CSize</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#"><span class="hs-identifier">GHC.Base</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#ByteArray%23"><span class="hs-identifier">ByteArray#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#MutableByteArray%23"><span class="hs-identifier">MutableByteArray#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier">Int</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>                 </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#indexWord16Array%23"><span class="hs-identifier">indexWord16Array#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#newByteArray%23"><span class="hs-identifier">newByteArray#</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>                 </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#unsafeFreezeByteArray%23"><span class="hs-identifier">unsafeFreezeByteArray#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#writeWord16Array%23"><span class="hs-identifier">writeWord16Array#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#"><span class="hs-identifier">GHC.ST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier">ST</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#runST"><span class="hs-identifier">runST</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#"><span class="hs-identifier">GHC.Word</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier">Word16</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier">length</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Text.Read.html#read"><span class="hs-identifier">read</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span class="hs-comment">-- | Immutable array type.</span><span>
</span><span id="line-61"></span><span class="hs-comment">--</span><span>
</span><span id="line-62"></span><span class="hs-comment">-- The 'Array' constructor is exposed since @text-1.1.1.3@</span><span>
</span><span id="line-63"></span><span class="hs-keyword">data</span><span> </span><span id="Array"><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-var">Array</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Array"><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-var">Array</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="aBA"><span class="annot"><span class="annottext">Array -&gt; ByteArray#
</span><a href="Data.Text.Array.html#aBA"><span class="hs-identifier hs-var hs-var">aBA</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#ByteArray%23"><span class="hs-identifier hs-type">ByteArray#</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span class="hs-comment">-- | Mutable array type, for use in the ST monad.</span><span>
</span><span id="line-66"></span><span class="hs-comment">--</span><span>
</span><span id="line-67"></span><span class="hs-comment">-- The 'MArray' constructor is exposed since @text-1.1.1.3@</span><span>
</span><span id="line-68"></span><span class="hs-keyword">data</span><span> </span><span id="MArray"><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-var">MArray</span></a></span></span><span> </span><span id="local-6989586621679104769"><span class="annot"><a href="#local-6989586621679104769"><span class="hs-identifier hs-type">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="MArray"><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-var">MArray</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="maBA"><span class="annot"><span class="annottext">forall s. MArray s -&gt; MutableByteArray# s
</span><a href="Data.Text.Array.html#maBA"><span class="hs-identifier hs-var hs-var">maBA</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#MutableByteArray%23"><span class="hs-identifier hs-type">MutableByteArray#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104769"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span class="hs-comment">-- | Create an uninitialized mutable array.</span><span>
</span><span id="line-71"></span><span class="annot"><a href="Data.Text.Array.html#new"><span class="hs-identifier hs-type">new</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679104766"><span class="annot"><a href="#local-6989586621679104766"><span class="hs-identifier hs-type">s</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104766"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-type">MArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104766"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-72"></span><span id="new"><span class="annot"><span class="annottext">new :: forall s. Int -&gt; ST s (MArray s)
</span><a href="Data.Text.Array.html#new"><span class="hs-identifier hs-var hs-var">new</span></a></span></span><span> </span><span id="local-6989586621679104666"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104666"><span class="hs-identifier hs-var">n</span></a></span></span><span>
</span><span id="line-73"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104666"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%7C%7C"><span class="hs-operator hs-var">||</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104666"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104663"><span class="hs-identifier hs-var">highBit</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%2F%3D"><span class="hs-operator hs-var">/=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ST s (MArray s)
forall a. a
</span><a href="Data.Text.Array.html#array_size_error"><span class="hs-identifier hs-var">array_size_error</span></a></span><span>
</span><span id="line-74"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STRep s (MArray s) -&gt; ST s (MArray s)
forall s a. STRep s a -&gt; ST s a
</span><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s (MArray s) -&gt; ST s (MArray s))
-&gt; STRep s (MArray s) -&gt; ST s (MArray s)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679104659"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679104659"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-75"></span><span>       </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; State# s -&gt; (# State# s, MutableByteArray# s #)
forall d. Int# -&gt; State# d -&gt; (# State# d, MutableByteArray# d #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#newByteArray%23"><span class="hs-identifier hs-var">newByteArray#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679104658"><span class="hs-identifier hs-var">len#</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679104659"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-76"></span><span>         </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679104657"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679104657"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679104656"><span class="annot"><span class="annottext">MutableByteArray# s
</span><a href="#local-6989586621679104656"><span class="hs-identifier hs-var">marr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679104657"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# s -&gt; MArray s
forall s. MutableByteArray# s -&gt; MArray s
</span><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-var">MArray</span></a></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# s
</span><a href="#local-6989586621679104656"><span class="hs-identifier hs-var">marr#</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-77"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679104658"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679104658"><span class="hs-identifier hs-var">len#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int
</span><a href="Data.Text.Array.html#bytesInArray"><span class="hs-identifier hs-var">bytesInArray</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104666"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-78"></span><span>        </span><span id="local-6989586621679104663"><span class="annot"><span class="annottext">highBit :: Int
</span><a href="#local-6989586621679104663"><span class="hs-identifier hs-var hs-var">highBit</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
forall a. Bounded a =&gt; a
</span><a href="../../base/src/GHC.Enum.html#maxBound"><span class="hs-identifier hs-var">maxBound</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#xor"><span class="hs-operator hs-var">`xor`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
forall a. Bounded a =&gt; a
</span><a href="../../base/src/GHC.Enum.html#maxBound"><span class="hs-identifier hs-var">maxBound</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. UnsafeShift a =&gt; a -&gt; Int -&gt; a
</span><a href="Data.Text.Internal.Unsafe.Shift.html#shiftR"><span class="hs-operator hs-var">`shiftR`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-79"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Array.html#new"><span class="hs-pragma hs-type">new</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span id="local-6989586621679104759"><span class="annot"><a href="Data.Text.Array.html#array_size_error"><span class="hs-identifier hs-type">array_size_error</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679104759"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-82"></span><span id="array_size_error"><span class="annot"><span class="annottext">array_size_error :: forall a. a
</span><a href="Data.Text.Array.html#array_size_error"><span class="hs-identifier hs-var hs-var">array_size_error</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; a
forall a. HasCallStack =&gt; [Char] -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Data.Text.Array.new: size overflow&quot;</span></span><span>
</span><span id="line-83"></span><span>
</span><span id="line-84"></span><span class="hs-comment">-- | Freeze a mutable array. Do not mutate the 'MArray' afterwards!</span><span>
</span><span id="line-85"></span><span id="local-6989586621679104745"><span class="annot"><a href="Data.Text.Array.html#unsafeFreeze"><span class="hs-identifier hs-type">unsafeFreeze</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-type">MArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104745"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104745"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-type">Array</span></a></span></span><span>
</span><span id="line-86"></span><span id="unsafeFreeze"><span class="annot"><span class="annottext">unsafeFreeze :: forall s. MArray s -&gt; ST s Array
</span><a href="Data.Text.Array.html#unsafeFreeze"><span class="hs-identifier hs-var hs-var">unsafeFreeze</span></a></span></span><span> </span><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-type">MArray</span></a></span><span class="hs-special">{</span><span id="local-6989586621679104645"><span class="annot"><span class="annottext">MutableByteArray# s
maBA :: MutableByteArray# s
maBA :: forall s. MArray s -&gt; MutableByteArray# s
</span><a href="#local-6989586621679104645"><span class="hs-glyph hs-var hs-var">..</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STRep s Array -&gt; ST s Array
forall s a. STRep s a -&gt; ST s a
</span><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s Array -&gt; ST s Array) -&gt; STRep s Array -&gt; ST s Array
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679104644"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679104644"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-87"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# s -&gt; State# s -&gt; (# State# s, ByteArray# #)
forall d.
MutableByteArray# d -&gt; State# d -&gt; (# State# d, ByteArray# #)
</span><a href="../../ghc-prim/src/GHC.Prim.html#unsafeFreezeByteArray%23"><span class="hs-identifier hs-var">unsafeFreezeByteArray#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# s
</span><a href="#local-6989586621679104645"><span class="hs-identifier hs-var">maBA</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679104644"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-88"></span><span>        </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621679104643"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679104643"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679104642"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679104642"><span class="hs-identifier hs-var">ba#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679104643"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteArray# -&gt; Array
</span><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-var">Array</span></a></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679104642"><span class="hs-identifier hs-var">ba#</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-89"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Array.html#unsafeFreeze"><span class="hs-pragma hs-type">unsafeFreeze</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span class="hs-comment">-- | Indicate how many bytes would be used for an array of the given</span><span>
</span><span id="line-92"></span><span class="hs-comment">-- size.</span><span>
</span><span id="line-93"></span><span class="annot"><a href="Data.Text.Array.html#bytesInArray"><span class="hs-identifier hs-type">bytesInArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-94"></span><span id="bytesInArray"><span class="annot"><span class="annottext">bytesInArray :: Int -&gt; Int
</span><a href="Data.Text.Array.html#bytesInArray"><span class="hs-identifier hs-var hs-var">bytesInArray</span></a></span></span><span> </span><span id="local-6989586621679104641"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104641"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104641"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. UnsafeShift a =&gt; a -&gt; Int -&gt; a
</span><a href="Data.Text.Internal.Unsafe.Shift.html#shiftL"><span class="hs-operator hs-var">`shiftL`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-95"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Array.html#bytesInArray"><span class="hs-pragma hs-type">bytesInArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span class="hs-comment">-- | Unchecked read of an immutable array.  May return garbage or</span><span>
</span><span id="line-98"></span><span class="hs-comment">-- crash on an out-of-bounds access.</span><span>
</span><span id="line-99"></span><span class="annot"><a href="Data.Text.Array.html#unsafeIndex"><span class="hs-identifier hs-type">unsafeIndex</span></a></span><span> </span><span class="hs-glyph">::</span><span class="hs-cpp">
#if defined(ASSERTS)
</span><span>  </span><span class="hs-identifier">HasCallStack</span><span> </span><span class="hs-glyph">=&gt;</span><span class="hs-cpp">
#endif
</span><span>  </span><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span>
</span><span id="line-104"></span><span id="unsafeIndex"><span class="annot"><span class="annottext">unsafeIndex :: Array -&gt; Int -&gt; Word16
</span><a href="Data.Text.Array.html#unsafeIndex"><span class="hs-identifier hs-var hs-var">unsafeIndex</span></a></span></span><span> </span><span id="local-6989586621679104640"><span class="annot"><span class="annottext">a :: Array
</span><a href="#local-6989586621679104640"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span class="hs-special">{</span><span id="local-6989586621679104639"><span class="annot"><span class="annottext">ByteArray#
aBA :: ByteArray#
aBA :: Array -&gt; ByteArray#
</span><a href="#local-6989586621679104639"><span class="hs-glyph hs-var hs-var">..</span></a></span></span><span class="hs-special">}</span><span> </span><span id="local-6989586621679104638"><span class="annot"><span class="annottext">i :: Int
</span><a href="#local-6989586621679104638"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679104637"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679104637"><span class="hs-identifier hs-var">i#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span class="hs-cpp">
#if defined(ASSERTS)
</span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="hs-identifier">word16len</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">I#</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">sizeofByteArray#</span><span> </span><span class="hs-identifier">aBA</span><span class="hs-special">)</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">quot</span><span class="hs-special">`</span><span> </span><span class="hs-number">2</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-107"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="hs-identifier">i</span><span> </span><span class="hs-operator">&lt;</span><span> </span><span class="hs-number">0</span><span> </span><span class="hs-operator">||</span><span> </span><span class="hs-identifier">i</span><span> </span><span class="hs-operator">&gt;=</span><span> </span><span class="hs-identifier">word16len</span><span>
</span><span id="line-108"></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="hs-identifier">error</span><span> </span><span class="hs-special">(</span><span class="hs-string">&quot;Data.Text.Array.unsafeIndex: bounds error, offset &quot;</span><span> </span><span class="hs-operator">++</span><span> </span><span class="hs-identifier">show</span><span> </span><span class="hs-identifier">i</span><span> </span><span class="hs-operator">++</span><span> </span><span class="hs-string">&quot;, length &quot;</span><span> </span><span class="hs-operator">++</span><span> </span><span class="hs-identifier">show</span><span> </span><span class="hs-identifier">word16len</span><span class="hs-special">)</span><span>
</span><span id="line-109"></span><span>  </span><span class="hs-keyword">else</span><span class="hs-cpp">
#endif
</span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteArray# -&gt; Int# -&gt; Word#
</span><a href="../../ghc-prim/src/GHC.Prim.html#indexWord16Array%23"><span class="hs-identifier hs-var">indexWord16Array#</span></a></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621679104639"><span class="hs-identifier hs-var">aBA</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679104637"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span id="local-6989586621679104636"><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621679104636"><span class="hs-identifier hs-var">r#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word# -&gt; Word16
</span><a href="../../base/src/GHC.Word.html#W16%23"><span class="hs-identifier hs-var">W16#</span></a></span><span> </span><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621679104636"><span class="hs-identifier hs-var">r#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-112"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Array.html#unsafeIndex"><span class="hs-pragma hs-type">unsafeIndex</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span class="hs-comment">-- | Unchecked write of a mutable array.  May return garbage or crash</span><span>
</span><span id="line-115"></span><span class="hs-comment">-- on an out-of-bounds access.</span><span>
</span><span id="line-116"></span><span id="local-6989586621679104743"><span class="annot"><a href="Data.Text.Array.html#unsafeWrite"><span class="hs-identifier hs-type">unsafeWrite</span></a></span><span> </span><span class="hs-glyph">::</span><span class="hs-cpp">
#if defined(ASSERTS)
</span><span>  </span><span class="hs-identifier">HasCallStack</span><span> </span><span class="hs-glyph">=&gt;</span><span class="hs-cpp">
#endif
</span><span>  </span><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-type">MArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104743"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104743"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-121"></span><span id="unsafeWrite"><span class="annot"><span class="annottext">unsafeWrite :: forall s. MArray s -&gt; Int -&gt; Word16 -&gt; ST s ()
</span><a href="Data.Text.Array.html#unsafeWrite"><span class="hs-identifier hs-var hs-var">unsafeWrite</span></a></span></span><span> </span><span id="local-6989586621679104634"><span class="annot"><span class="annottext">ma :: MArray s
</span><a href="#local-6989586621679104634"><span class="hs-identifier hs-var">ma</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-type">MArray</span></a></span><span class="hs-special">{</span><span id="local-6989586621679104633"><span class="annot"><span class="annottext">MutableByteArray# s
maBA :: MutableByteArray# s
maBA :: forall s. MArray s -&gt; MutableByteArray# s
</span><a href="#local-6989586621679104633"><span class="hs-glyph hs-var hs-var">..</span></a></span></span><span class="hs-special">}</span><span> </span><span id="local-6989586621679104632"><span class="annot"><span class="annottext">i :: Int
</span><a href="#local-6989586621679104632"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#I%23"><span class="hs-identifier hs-type">I#</span></a></span><span> </span><span id="local-6989586621679104631"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679104631"><span class="hs-identifier hs-var">i#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Word.html#W16%23"><span class="hs-identifier hs-type">W16#</span></a></span><span> </span><span id="local-6989586621679104630"><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621679104630"><span class="hs-identifier hs-var">e#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STRep s () -&gt; ST s ()
forall s a. STRep s a -&gt; ST s a
</span><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-var">ST</span></a></span><span> </span><span class="annot"><span class="annottext">(STRep s () -&gt; ST s ()) -&gt; STRep s () -&gt; ST s ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679104629"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679104629"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span class="hs-cpp">
#if defined(ASSERTS)
</span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="hs-identifier">word16len</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">I#</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">sizeofMutableByteArray#</span><span> </span><span class="hs-identifier">maBA</span><span class="hs-special">)</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">quot</span><span class="hs-special">`</span><span> </span><span class="hs-number">2</span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-124"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="hs-identifier">i</span><span> </span><span class="hs-operator">&lt;</span><span> </span><span class="hs-number">0</span><span> </span><span class="hs-operator">||</span><span> </span><span class="hs-identifier">i</span><span> </span><span class="hs-operator">&gt;=</span><span> </span><span class="hs-identifier">word16len</span><span> </span><span class="hs-keyword">then</span><span> </span><span class="hs-identifier">error</span><span> </span><span class="hs-special">(</span><span class="hs-string">&quot;Data.Text.Array.unsafeWrite: bounds error, offset &quot;</span><span> </span><span class="hs-operator">++</span><span> </span><span class="hs-identifier">show</span><span> </span><span class="hs-identifier">i</span><span> </span><span class="hs-operator">++</span><span> </span><span class="hs-string">&quot;, length &quot;</span><span> </span><span class="hs-operator">++</span><span> </span><span class="hs-identifier">show</span><span> </span><span class="hs-identifier">word16len</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">else</span><span class="hs-cpp">
#endif
</span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# s -&gt; Int# -&gt; Word# -&gt; State# s -&gt; State# s
forall d.
MutableByteArray# d -&gt; Int# -&gt; Word# -&gt; State# d -&gt; State# d
</span><a href="../../ghc-prim/src/GHC.Prim.html#writeWord16Array%23"><span class="hs-identifier hs-var">writeWord16Array#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# s
</span><a href="#local-6989586621679104633"><span class="hs-identifier hs-var">maBA</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621679104631"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Word#
</span><a href="#local-6989586621679104630"><span class="hs-identifier hs-var">e#</span></a></span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679104629"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-127"></span><span>    </span><span id="local-6989586621679104628"><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679104628"><span class="hs-identifier hs-var">s2#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# s
</span><a href="#local-6989586621679104628"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-128"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Array.html#unsafeWrite"><span class="hs-pragma hs-type">unsafeWrite</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span class="hs-comment">-- | Convert an immutable array to a list.</span><span>
</span><span id="line-131"></span><span class="annot"><a href="Data.Text.Array.html#toList"><span class="hs-identifier hs-type">toList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Word.html#Word16"><span class="hs-identifier hs-type">Word16</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-132"></span><span id="toList"><span class="annot"><span class="annottext">toList :: Array -&gt; Int -&gt; Int -&gt; [Word16]
</span><a href="Data.Text.Array.html#toList"><span class="hs-identifier hs-var hs-var">toList</span></a></span></span><span> </span><span id="local-6989586621679104627"><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679104627"><span class="hs-identifier hs-var">ary</span></a></span></span><span> </span><span id="local-6989586621679104626"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104626"><span class="hs-identifier hs-var">off</span></a></span></span><span> </span><span id="local-6989586621679104625"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104625"><span class="hs-identifier hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Word16]
</span><a href="#local-6989586621679104624"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-133"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679104624"><span class="annot"><span class="annottext">loop :: Int -&gt; [Word16]
</span><a href="#local-6989586621679104624"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621679104619"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104619"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104619"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104625"><span class="hs-identifier hs-var">len</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array -&gt; Int -&gt; Word16
</span><a href="Data.Text.Array.html#unsafeIndex"><span class="hs-identifier hs-var">unsafeIndex</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679104627"><span class="hs-identifier hs-var">ary</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104626"><span class="hs-identifier hs-var">off</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104619"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Word16 -&gt; [Word16] -&gt; [Word16]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Word16]
</span><a href="#local-6989586621679104624"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104619"><span class="hs-identifier hs-var">i</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-134"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span><span class="hs-comment">-- | An empty immutable array.</span><span>
</span><span id="line-137"></span><span class="annot"><a href="Data.Text.Array.html#empty"><span class="hs-identifier hs-type">empty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span>
</span><span id="line-138"></span><span id="empty"><span class="annot"><span class="annottext">empty :: Array
</span><a href="Data.Text.Array.html#empty"><span class="hs-identifier hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall s. ST s Array) -&gt; Array
forall a. (forall s. ST s a) -&gt; a
</span><a href="../../base/src/GHC.ST.html#runST"><span class="hs-identifier hs-var">runST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ST s (MArray s)
forall s. Int -&gt; ST s (MArray s)
</span><a href="Data.Text.Array.html#new"><span class="hs-identifier hs-var">new</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">ST s (MArray s) -&gt; (MArray s -&gt; ST s Array) -&gt; ST s Array
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">MArray s -&gt; ST s Array
forall s. MArray s -&gt; ST s Array
</span><a href="Data.Text.Array.html#unsafeFreeze"><span class="hs-identifier hs-var">unsafeFreeze</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span class="hs-comment">-- | Run an action in the ST monad and return an immutable array of</span><span>
</span><span id="line-141"></span><span class="hs-comment">-- its result.</span><span>
</span><span id="line-142"></span><span class="annot"><a href="Data.Text.Array.html#run"><span class="hs-identifier hs-type">run</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679104732"><span class="annot"><a href="#local-6989586621679104732"><span class="hs-identifier hs-type">s</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104732"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-type">MArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104732"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span>
</span><span id="line-143"></span><span id="run"><span class="annot"><span class="annottext">run :: (forall s. ST s (MArray s)) -&gt; Array
</span><a href="Data.Text.Array.html#run"><span class="hs-identifier hs-var hs-var">run</span></a></span></span><span> </span><span id="local-6989586621679104615"><span class="annot"><span class="annottext">forall s. ST s (MArray s)
</span><a href="#local-6989586621679104615"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall s. ST s Array) -&gt; Array
forall a. (forall s. ST s a) -&gt; a
</span><a href="../../base/src/GHC.ST.html#runST"><span class="hs-identifier hs-var">runST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ST s (MArray s)
forall s. ST s (MArray s)
</span><a href="#local-6989586621679104615"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">ST s (MArray s) -&gt; (MArray s -&gt; ST s Array) -&gt; ST s Array
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">MArray s -&gt; ST s Array
forall s. MArray s -&gt; ST s Array
</span><a href="Data.Text.Array.html#unsafeFreeze"><span class="hs-identifier hs-var">unsafeFreeze</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span class="hs-comment">-- | Run an action in the ST monad and return an immutable array of</span><span>
</span><span id="line-146"></span><span class="hs-comment">-- its result paired with whatever else the action returns.</span><span>
</span><span id="line-147"></span><span id="local-6989586621679104729"><span class="annot"><a href="Data.Text.Array.html#run2"><span class="hs-identifier hs-type">run2</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679104730"><span class="annot"><a href="#local-6989586621679104730"><span class="hs-identifier hs-type">s</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104730"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-type">MArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104730"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679104729"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679104729"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-148"></span><span id="run2"><span class="annot"><span class="annottext">run2 :: forall a. (forall s. ST s (MArray s, a)) -&gt; (Array, a)
</span><a href="Data.Text.Array.html#run2"><span class="hs-identifier hs-var hs-var">run2</span></a></span></span><span> </span><span id="local-6989586621679104613"><span class="annot"><span class="annottext">forall s. ST s (MArray s, a)
</span><a href="#local-6989586621679104613"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall s. ST s (Array, a)) -&gt; (Array, a)
forall a. (forall s. ST s a) -&gt; a
</span><a href="../../base/src/GHC.ST.html#runST"><span class="hs-identifier hs-var">runST</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span>
</span><span id="line-149"></span><span>                 </span><span class="hs-special">(</span><span id="local-6989586621679104609"><span class="annot"><span class="annottext">MArray s
</span><a href="#local-6989586621679104609"><span class="hs-identifier hs-var">marr</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679104608"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679104608"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ST s (MArray s, a)
forall s. ST s (MArray s, a)
</span><a href="#local-6989586621679104613"><span class="hs-identifier hs-var">k</span></a></span><span>
</span><span id="line-150"></span><span>                 </span><span id="local-6989586621679104607"><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679104607"><span class="hs-identifier hs-var">arr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">MArray s -&gt; ST s Array
forall s. MArray s -&gt; ST s Array
</span><a href="Data.Text.Array.html#unsafeFreeze"><span class="hs-identifier hs-var">unsafeFreeze</span></a></span><span> </span><span class="annot"><span class="annottext">MArray s
</span><a href="#local-6989586621679104609"><span class="hs-identifier hs-var">marr</span></a></span><span>
</span><span id="line-151"></span><span>                 </span><span class="annot"><span class="annottext">(Array, a) -&gt; ST s (Array, a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679104607"><span class="hs-identifier hs-var">arr</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679104608"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Array.html#run2"><span class="hs-pragma hs-type">run2</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span class="hs-comment">-- | Copy some elements of a mutable array.</span><span>
</span><span id="line-155"></span><span id="local-6989586621679104725"><span class="annot"><a href="Data.Text.Array.html#copyM"><span class="hs-identifier hs-type">copyM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-type">MArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104725"><span class="hs-identifier hs-type">s</span></a></span><span>               </span><span class="hs-comment">-- ^ Destination</span><span>
</span><span id="line-156"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>                    </span><span class="hs-comment">-- ^ Destination offset</span><span>
</span><span id="line-157"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-type">MArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104725"><span class="hs-identifier hs-type">s</span></a></span><span>               </span><span class="hs-comment">-- ^ Source</span><span>
</span><span id="line-158"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>                    </span><span class="hs-comment">-- ^ Source offset</span><span>
</span><span id="line-159"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>                    </span><span class="hs-comment">-- ^ Count</span><span>
</span><span id="line-160"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104725"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-161"></span><span id="copyM"><span class="annot"><span class="annottext">copyM :: forall s. MArray s -&gt; Int -&gt; MArray s -&gt; Int -&gt; Int -&gt; ST s ()
</span><a href="Data.Text.Array.html#copyM"><span class="hs-identifier hs-var hs-var">copyM</span></a></span></span><span> </span><span id="local-6989586621679104603"><span class="annot"><span class="annottext">MArray s
</span><a href="#local-6989586621679104603"><span class="hs-identifier hs-var">dest</span></a></span></span><span> </span><span id="local-6989586621679104602"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104602"><span class="hs-identifier hs-var">didx</span></a></span></span><span> </span><span id="local-6989586621679104601"><span class="annot"><span class="annottext">MArray s
</span><a href="#local-6989586621679104601"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span id="local-6989586621679104600"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104600"><span class="hs-identifier hs-var">sidx</span></a></span></span><span> </span><span id="local-6989586621679104599"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104599"><span class="hs-identifier hs-var">count</span></a></span></span><span>
</span><span id="line-162"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104599"><span class="hs-identifier hs-var">count</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C%3D"><span class="hs-operator hs-var">&lt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; ST s ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span class="hs-cpp">
#if defined(ASSERTS)
</span><span>    </span><span class="hs-identifier">assert</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">sidx</span><span> </span><span class="hs-operator">+</span><span> </span><span class="hs-identifier">count</span><span> </span><span class="hs-operator">&lt;=</span><span> </span><span class="hs-identifier">I#</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">sizeofMutableByteArray#</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">maBA</span><span> </span><span class="hs-identifier">src</span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="hs-special">`</span><span class="hs-identifier">quot</span><span class="hs-special">`</span><span> </span><span class="hs-number">2</span><span class="hs-special">)</span><span> </span><span class="hs-operator">.</span><span>
</span><span id="line-166"></span><span>    </span><span class="hs-identifier">assert</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">didx</span><span> </span><span class="hs-operator">+</span><span> </span><span class="hs-identifier">count</span><span> </span><span class="hs-operator">&lt;=</span><span> </span><span class="hs-identifier">I#</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">sizeofMutableByteArray#</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">maBA</span><span> </span><span class="hs-identifier">dest</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">quot</span><span class="hs-special">`</span><span> </span><span class="hs-number">2</span><span class="hs-special">)</span><span> </span><span class="hs-operator">.</span><span class="hs-cpp">
#endif
</span><span>    </span><span class="annot"><span class="annottext">IO () -&gt; ST s ()
forall a s. IO a -&gt; ST s a
</span><a href="../../base/src/GHC.IO.html#unsafeIOToST"><span class="hs-identifier hs-var">unsafeIOToST</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; ST s ()) -&gt; IO () -&gt; ST s ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# s
-&gt; CSize -&gt; MutableByteArray# s -&gt; CSize -&gt; CSize -&gt; IO ()
forall s.
MutableByteArray# s
-&gt; CSize -&gt; MutableByteArray# s -&gt; CSize -&gt; CSize -&gt; IO ()
</span><a href="Data.Text.Array.html#memcpyM"><span class="hs-identifier hs-var">memcpyM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MArray s -&gt; MutableByteArray# s
forall s. MArray s -&gt; MutableByteArray# s
</span><a href="Data.Text.Array.html#maBA"><span class="hs-identifier hs-var hs-var">maBA</span></a></span><span> </span><span class="annot"><span class="annottext">MArray s
</span><a href="#local-6989586621679104603"><span class="hs-identifier hs-var">dest</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; CSize
</span><a href="Data.Text.Array.html#intToCSize"><span class="hs-identifier hs-var">intToCSize</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104602"><span class="hs-identifier hs-var">didx</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span>                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MArray s -&gt; MutableByteArray# s
forall s. MArray s -&gt; MutableByteArray# s
</span><a href="Data.Text.Array.html#maBA"><span class="hs-identifier hs-var hs-var">maBA</span></a></span><span> </span><span class="annot"><span class="annottext">MArray s
</span><a href="#local-6989586621679104601"><span class="hs-identifier hs-var">src</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; CSize
</span><a href="Data.Text.Array.html#intToCSize"><span class="hs-identifier hs-var">intToCSize</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104600"><span class="hs-identifier hs-var">sidx</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; CSize
</span><a href="Data.Text.Array.html#intToCSize"><span class="hs-identifier hs-var">intToCSize</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104599"><span class="hs-identifier hs-var">count</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Array.html#copyM"><span class="hs-pragma hs-type">copyM</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-172"></span><span>
</span><span id="line-173"></span><span class="hs-comment">-- | Copy some elements of an immutable array.</span><span>
</span><span id="line-174"></span><span id="local-6989586621679104720"><span class="annot"><a href="Data.Text.Array.html#copyI"><span class="hs-identifier hs-type">copyI</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Array.html#MArray"><span class="hs-identifier hs-type">MArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104720"><span class="hs-identifier hs-type">s</span></a></span><span>               </span><span class="hs-comment">-- ^ Destination</span><span>
</span><span id="line-175"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>                    </span><span class="hs-comment">-- ^ Destination offset</span><span>
</span><span id="line-176"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span>                  </span><span class="hs-comment">-- ^ Source</span><span>
</span><span id="line-177"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>                    </span><span class="hs-comment">-- ^ Source offset</span><span>
</span><span id="line-178"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>                    </span><span class="hs-comment">-- ^ First offset in destination /not/ to</span><span>
</span><span id="line-179"></span><span>                                </span><span class="hs-comment">-- copy (i.e. /not/ length)</span><span>
</span><span id="line-180"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104720"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-181"></span><span id="copyI"><span class="annot"><span class="annottext">copyI :: forall s. MArray s -&gt; Int -&gt; Array -&gt; Int -&gt; Int -&gt; ST s ()
</span><a href="Data.Text.Array.html#copyI"><span class="hs-identifier hs-var hs-var">copyI</span></a></span></span><span> </span><span id="local-6989586621679104592"><span class="annot"><span class="annottext">MArray s
</span><a href="#local-6989586621679104592"><span class="hs-identifier hs-var">dest</span></a></span></span><span> </span><span id="local-6989586621679104591"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104591"><span class="hs-identifier hs-var">i0</span></a></span></span><span> </span><span id="local-6989586621679104590"><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679104590"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span id="local-6989586621679104589"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104589"><span class="hs-identifier hs-var">j0</span></a></span></span><span> </span><span id="local-6989586621679104588"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104588"><span class="hs-identifier hs-var">top</span></a></span></span><span>
</span><span id="line-182"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104591"><span class="hs-identifier hs-var">i0</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104588"><span class="hs-identifier hs-var">top</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; ST s ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-183"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; ST s ()
forall a s. IO a -&gt; ST s a
</span><a href="../../base/src/GHC.IO.html#unsafeIOToST"><span class="hs-identifier hs-var">unsafeIOToST</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; ST s ()) -&gt; IO () -&gt; ST s ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-184"></span><span>                  </span><span class="annot"><span class="annottext">MutableByteArray# s
-&gt; CSize -&gt; ByteArray# -&gt; CSize -&gt; CSize -&gt; IO ()
forall s.
MutableByteArray# s
-&gt; CSize -&gt; ByteArray# -&gt; CSize -&gt; CSize -&gt; IO ()
</span><a href="Data.Text.Array.html#memcpyI"><span class="hs-identifier hs-var">memcpyI</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MArray s -&gt; MutableByteArray# s
forall s. MArray s -&gt; MutableByteArray# s
</span><a href="Data.Text.Array.html#maBA"><span class="hs-identifier hs-var hs-var">maBA</span></a></span><span> </span><span class="annot"><span class="annottext">MArray s
</span><a href="#local-6989586621679104592"><span class="hs-identifier hs-var">dest</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; CSize
</span><a href="Data.Text.Array.html#intToCSize"><span class="hs-identifier hs-var">intToCSize</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104591"><span class="hs-identifier hs-var">i0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-185"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array -&gt; ByteArray#
</span><a href="Data.Text.Array.html#aBA"><span class="hs-identifier hs-var hs-var">aBA</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679104590"><span class="hs-identifier hs-var">src</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; CSize
</span><a href="Data.Text.Array.html#intToCSize"><span class="hs-identifier hs-var">intToCSize</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104589"><span class="hs-identifier hs-var">j0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-186"></span><span>                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; CSize
</span><a href="Data.Text.Array.html#intToCSize"><span class="hs-identifier hs-var">intToCSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104588"><span class="hs-identifier hs-var">top</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104591"><span class="hs-identifier hs-var">i0</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-187"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Array.html#copyI"><span class="hs-pragma hs-type">copyI</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span class="hs-comment">-- | Compare portions of two arrays for equality.  No bounds checking</span><span>
</span><span id="line-190"></span><span class="hs-comment">-- is performed.</span><span>
</span><span id="line-191"></span><span class="annot"><a href="Data.Text.Array.html#equal"><span class="hs-identifier hs-type">equal</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span>                  </span><span class="hs-comment">-- ^ First</span><span>
</span><span id="line-192"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>                    </span><span class="hs-comment">-- ^ Offset into first</span><span>
</span><span id="line-193"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Data.Text.Array.html#Array"><span class="hs-identifier hs-type">Array</span></a></span><span>                  </span><span class="hs-comment">-- ^ Second</span><span>
</span><span id="line-194"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>                    </span><span class="hs-comment">-- ^ Offset into second</span><span>
</span><span id="line-195"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>                    </span><span class="hs-comment">-- ^ Count</span><span>
</span><span id="line-196"></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-197"></span><span id="equal"><span class="annot"><span class="annottext">equal :: Array -&gt; Int -&gt; Array -&gt; Int -&gt; Int -&gt; Bool
</span><a href="Data.Text.Array.html#equal"><span class="hs-identifier hs-var hs-var">equal</span></a></span></span><span> </span><span id="local-6989586621679104586"><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679104586"><span class="hs-identifier hs-var">arrA</span></a></span></span><span> </span><span id="local-6989586621679104585"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104585"><span class="hs-identifier hs-var">offA</span></a></span></span><span> </span><span id="local-6989586621679104584"><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679104584"><span class="hs-identifier hs-var">arrB</span></a></span></span><span> </span><span id="local-6989586621679104583"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104583"><span class="hs-identifier hs-var">offB</span></a></span></span><span> </span><span id="local-6989586621679104582"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104582"><span class="hs-identifier hs-var">count</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO Bool -&gt; Bool
forall a. IO a -&gt; a
</span><a href="Data.Text.Internal.Unsafe.html#inlinePerformIO"><span class="hs-identifier hs-var">inlinePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Bool -&gt; Bool) -&gt; IO Bool -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-198"></span><span>  </span><span id="local-6989586621679104581"><span class="annot"><span class="annottext">CInt
</span><a href="#local-6989586621679104581"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteArray# -&gt; CSize -&gt; ByteArray# -&gt; CSize -&gt; CSize -&gt; IO CInt
</span><a href="Data.Text.Array.html#memcmp"><span class="hs-identifier hs-var">memcmp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array -&gt; ByteArray#
</span><a href="Data.Text.Array.html#aBA"><span class="hs-identifier hs-var hs-var">aBA</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679104586"><span class="hs-identifier hs-var">arrA</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; CSize
</span><a href="Data.Text.Array.html#intToCSize"><span class="hs-identifier hs-var">intToCSize</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104585"><span class="hs-identifier hs-var">offA</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-199"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Array -&gt; ByteArray#
</span><a href="Data.Text.Array.html#aBA"><span class="hs-identifier hs-var hs-var">aBA</span></a></span><span> </span><span class="annot"><span class="annottext">Array
</span><a href="#local-6989586621679104584"><span class="hs-identifier hs-var">arrB</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; CSize
</span><a href="Data.Text.Array.html#intToCSize"><span class="hs-identifier hs-var">intToCSize</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104583"><span class="hs-identifier hs-var">offB</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; CSize
</span><a href="Data.Text.Array.html#intToCSize"><span class="hs-identifier hs-var">intToCSize</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679104582"><span class="hs-identifier hs-var">count</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-200"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; IO Bool) -&gt; Bool -&gt; IO Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">CInt
</span><a href="#local-6989586621679104581"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">CInt -&gt; CInt -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">CInt
</span><span class="hs-number">0</span></span><span>
</span><span id="line-201"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Data.Text.Array.html#equal"><span class="hs-pragma hs-type">equal</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-202"></span><span>
</span><span id="line-203"></span><span class="annot"><a href="Data.Text.Array.html#intToCSize"><span class="hs-identifier hs-type">intToCSize</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CSize"><span class="hs-identifier hs-type">CSize</span></a></span><span>
</span><span id="line-204"></span><span id="intToCSize"><span class="annot"><span class="annottext">intToCSize :: Int -&gt; CSize
</span><a href="Data.Text.Array.html#intToCSize"><span class="hs-identifier hs-var hs-var">intToCSize</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; CSize
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span>
</span><span id="line-205"></span><span>
</span><span id="line-206"></span><span id="local-6989586621679104718"><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-keyword">ccall</span></span><span> </span><span class="annot"><span class="hs-keyword">unsafe</span></span><span> </span><span class="annot"><span class="hs-string">&quot;_hs_text_memcpy&quot;</span></span><span> </span><span id="memcpyI"><span class="annot"><a href="Data.Text.Array.html#memcpyI"><span class="hs-identifier hs-var">memcpyI</span></a></span></span><span>
</span><span id="line-207"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#MutableByteArray%23"><span class="hs-identifier hs-type">MutableByteArray#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104718"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CSize"><span class="hs-identifier hs-type">CSize</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#ByteArray%23"><span class="hs-identifier hs-type">ByteArray#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CSize"><span class="hs-identifier hs-type">CSize</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CSize"><span class="hs-identifier hs-type">CSize</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-keyword">ccall</span></span><span> </span><span class="annot"><span class="hs-keyword">unsafe</span></span><span> </span><span class="annot"><span class="hs-string">&quot;_hs_text_memcmp&quot;</span></span><span> </span><span id="memcmp"><span class="annot"><a href="Data.Text.Array.html#memcmp"><span class="hs-identifier hs-var">memcmp</span></a></span></span><span>
</span><span id="line-210"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#ByteArray%23"><span class="hs-identifier hs-type">ByteArray#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CSize"><span class="hs-identifier hs-type">CSize</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#ByteArray%23"><span class="hs-identifier hs-type">ByteArray#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CSize"><span class="hs-identifier hs-type">CSize</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CSize"><span class="hs-identifier hs-type">CSize</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CInt"><span class="hs-identifier hs-type">CInt</span></a></span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span id="local-6989586621679104721"><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-keyword">ccall</span></span><span> </span><span class="annot"><span class="hs-keyword">unsafe</span></span><span> </span><span class="annot"><span class="hs-string">&quot;_hs_text_memcpy&quot;</span></span><span> </span><span id="memcpyM"><span class="annot"><a href="Data.Text.Array.html#memcpyM"><span class="hs-identifier hs-var">memcpyM</span></a></span></span><span>
</span><span id="line-213"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#MutableByteArray%23"><span class="hs-identifier hs-type">MutableByteArray#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104721"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CSize"><span class="hs-identifier hs-type">CSize</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#MutableByteArray%23"><span class="hs-identifier hs-type">MutableByteArray#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679104721"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CSize"><span class="hs-identifier hs-type">CSize</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.Types.html#CSize"><span class="hs-identifier hs-type">CSize</span></a></span><span>
</span><span id="line-214"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-215"></span></pre></body></html>